Skip to content

Conversation

@ArqTras
Copy link

@ArqTras ArqTras commented Jan 6, 2026

ZeroMQ/cppzmq Migration to Modern API

Summary

This PR migrates the project from deprecated ZeroMQ/cppzmq API to the modern set() API with zmq::sockopt, eliminating all ZeroMQ-related compiler warnings while maintaining full backward compatibility.

Changes

Code Migration

  • Updated cppzmq headers to latest version from GitHub
  • Migrated 19 API calls from deprecated setsockopt() to modern set() API:
    • src/arqnet/sn_network.cpp - 18 occurrences
    • src/rpc/zmq_server.cpp - 1 occurrence
  • Maintained backward compatibility with malbit code style using ZMQ_VERSION checks

Documentation

  • Updated README.md with platform-specific package versions:
    • Ubuntu 24.04: ZeroMQ 4.3.5-1build2, libsodium 1.0.18+
    • macOS: ZeroMQ 4.3.5_2, libsodium 1.0.20+
  • Added comprehensive migration report (ZEROMQ_MIGRATION_REPORT.md)

Results

Zero compilation errors
Zero ZeroMQ/cppzmq warnings (reduced from 37)
Backward compatibility maintained (malbit style preserved)
All binaries built successfully
Compatible with Ubuntu 24.04 and macOS system packages

Compatibility

  • Minimum ZeroMQ version: >= 4.3.2 (unchanged)
  • System packages: Works with Ubuntu 24.04 (4.3.5-1build2) and macOS Homebrew (4.3.5_2)
  • cppzmq: Uses bundled headers from external/cppzmq/ for consistent API
  • Backward compatibility: Code includes fallback for ZeroMQ < 4.3.0

Testing

  • ✅ Compiled successfully on macOS (ARM64)
  • ✅ All ZeroMQ/cppzmq warnings eliminated
  • ✅ All binaries built correctly
  • ✅ Backward compatibility checks verified

Files Changed

  • external/cppzmq/zmq.hpp - Updated to latest version
  • external/cppzmq/zmq_addon.hpp - Updated to latest version
  • src/arqnet/sn_network.cpp - Migrated to new API (18 calls)
  • src/rpc/zmq_server.cpp - Migrated to new API (1 call)
  • README.md - Updated with platform-specific versions
  • ZEROMQ_MIGRATION_REPORT.md - Comprehensive migration documentation

Review Checklist

Please review:

  • Code style matches malbit repository conventions
  • Backward compatibility is properly maintained
  • All API migrations are correct
  • Documentation is accurate
  • No regressions introduced

Related

This migration addresses deprecation warnings from cppzmq 4.7.0+ and ensures compatibility with system ZeroMQ packages on Ubuntu 24.04 and macOS.

- Updated cppzmq headers to latest version from GitHub
- Migrated all setsockopt() calls to new set() API with zmq::sockopt
- Updated 19 occurrences across 2 files:
  * src/arqnet/sn_network.cpp (18 occurrences)
  * src/rpc/zmq_server.cpp (1 occurrence)
- Maintained backward compatibility with ZMQ_IDENTITY for older ZeroMQ versions
- All ZeroMQ/cppzmq warnings eliminated (37 -> 0)
- Added compatibility verification documentation
- Build successful with 0 warnings
…pzmq

- Deleted `WERYFIKACJA_KOMPATYBILNOSCI_ZMQ.md` and `PODSUMOWANIE_OSTRZEZEN.md` files as they are no longer needed.
- These documents contained outdated information regarding ZeroMQ compatibility and compilation warnings.
- Added compatibility for OpenSSL 3.0+ by introducing modern API calls for EC key generation and RSA key assignment.
- Included necessary headers for EC support and updated existing structures to manage EC keys.
- Ensured backward compatibility with OpenSSL 1.1.1 by providing fallback implementations.
- Improved error handling and logging for key generation processes.
- Deleted the OpenSSL migration report as it is no longer needed.
- Cleaned up `net_ssl.cpp` by removing unused includes and unnecessary conditional compilation for deprecated EC key management.
- Streamlined RSA key assignment logic to focus on the current OpenSSL version without legacy checks.
- Improved code clarity and maintainability by eliminating outdated structures and comments.
@malbit malbit merged commit 7bfaf89 into malbit:new_boost Jan 6, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants